<template>
    <div class="person-list">
        <PublicTable
            table-name="T_ROLE"
            page-title="角色"
            show-details
            :table-columns="tableColumns"
            :form-fields="formConfig"
            :form-rules="formRules"
            :search-fields="searchFields"
        >
        </PublicTable>
    </div>
</template>

<script setup>
import PublicTable from '@/components/PublicTable/index.vue';
import useConfig from './useConfig';
import PermissBtn from './PermissBtn.vue';
import { h } from 'vue';

const tableColumns = [
    {
        title: '角色名称',
        key: 'name',
        ellipsis: {
            tooltip: true
        }
    },
    {
        title: '角色权限',
        key: 'permission',
        ellipsis: {
            tooltip: true
        },
        render(row) {
            return h(PermissBtn, { data: row });
        }
    }
];
const searchFields = ['name'];
const { formConfig, formRules } = useConfig();
</script>
<style lang="less" scoped>
.person-list {
    width: 100%;
    height: 100%;
}
</style>
